home *** CD-ROM | disk | FTP | other *** search
- on printDailyCalendar dayNo
- global printer, gPropFont, previewOnly, usrName, userNo, currentCycleNo, stamp, mucus, relations, endDate, beginDate
- cursor(4)
- set max to count(stamp)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- printer(mSetTextFont, gPropFont)
- printer(mTextBox, 0, 40, w, 150, 0)
- printer(mSetTextSize, 12)
- printer(mSetTextStyle, "normal,bold")
- printer(mAppendText, getAt(usrName, userNo) & "'s Daily Calendar Page for Day: " & dayNo & " " && GetLongDate(beginDate + dayNo - 1) & RETURN & RETURN)
- printer(mSetTextSize, 12)
- printer(mSetTextStyle, "normal")
- printer(mAppendText, "Cycle #" & currentCycleNo & RETURN & RETURN & "First Entry: " && GetLongDate(beginDate) & RETURN & "Last Entry: " && GetLongDate(endDate))
- if the hilite of member "color" or (previewOnly = 1) then
- set stampName to "ministamp"
- set relationName to "miniRel"
- else
- set stampName to "graystamp"
- set stampNames to [" Red", " Brown", "White Baby", "Yellow Baby", "Brown Baby", " Yellow", " Peak Day"]
- set relationName to "grayrel"
- end if
- set eachHeight to 170
- printer(mSetTextSize, 14)
- printer(mSetTextStyle, "normal,bold")
- if getAt(stamp, dayNo) <> 0 then
- printer(mPicture, the picture of member (stampName && string(getAt(stamp, dayNo))), 15, eachHeight)
- printer(mDrawText, "Stamp", 4, eachHeight - 5)
- if not (the hilite of member "color") and (previewOnly = 0) then
- printer(mSetTextSize, 12)
- printer(mSetTextStyle, "normal,italic")
- set PlaceNo to getAt(stamp, dayNo)
- if PlaceNo = 10 then
- set PlaceNo to 7
- end if
- printer(mDrawText, getAt(stampNames, PlaceNo), 0, eachHeight + 38)
- printer(mSetTextSize, 14)
- printer(mSetTextStyle, "normal,bold")
- end if
- if getAt(mucus, dayNo) <> 0 then
- printer(mPicture, the picture of member ("miniMucus " & string(getAt(mucus, dayNo))), 112, eachHeight)
- printer(mDrawText, "Mucus", 100, eachHeight - 5)
- end if
- if dayNo < count(stamp) then
- if getAt(relations, dayNo) <> 0 then
- printer(mPicture, the picture of member (relationName && string(getAt(relations, dayNo))), 215, eachHeight)
- printer(mDrawText, "Relations", 200, eachHeight - 5)
- end if
- end if
- printer(mTextBox, 0, 350, w, h, 0)
- if getAt(comments, dayNo) <> " " then
- printer(mSetTextStyle, "bold")
- printer(mSetTextSize, 14)
- printer(mAppendText, "Comments" & RETURN)
- printer(mSetTextStyle, "normal,italic")
- printer(mSetTextSize, 12)
- printer(mAppendText, string(getAt(comments, dayNo)) & RETURN & RETURN)
- end if
- if getAt(advice, dayNo) <> 0 then
- printer(mSetTextStyle, "normal, bold")
- printer(mSetTextSize, 14)
- printer(mAppendText, "Advice" & RETURN)
- printer(mSetTextStyle, "normal")
- printer(mSetTextSize, 12)
- printer(mAppendText, the text of field ("advice" && string(getAt(advice, dayNo))) & RETURN & RETURN)
- end if
- if getAt(basis, dayNo) <> 0 then
- printer(mSetTextStyle, "normal,bold")
- printer(mSetTextSize, 14)
- printer(mAppendText, " " & RETURN & "Explanation" & RETURN)
- printer(mSetTextStyle, "normal")
- printer(mSetTextSize, 12)
- printer(mAppendText, the text of field ("basis" && string(getAt(basis, dayNo))) & RETURN & RETURN)
- end if
- cursor(0)
- end if
- end
-
- on mainPrintOrder
- global printer, gPropFont, w, h
- cursor(4)
- printer(mReset)
- printer(mSetLandscapeMode, 0)
- printer(mSetDocumentName, "Nature's Method Order Form")
- printer(mSetProgressMsg, "Nature's Method Order Form")
- printer(mSetMargins, 60, 60, 60, 0)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- printer(mSetPageNumSymbol, "√û")
- printer(mSetTextFont, gPropFont)
- printer(mSetTextSize, 14)
- printer(mSetTextStyle, "normal,bold")
- printer(mSetTextJust, "left")
- printer(mDrawText, "FAF Order Form", 0, 8)
- printer(mSetTextFont, gPropFont)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal,italic")
- printer(mSetTextJust, "right")
- printer(mDrawText, the date, w, 8)
- printer(mLine, 0, 18, w, 18)
- printer(mSetTextJust, "left")
- printer(mNewPage)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- printer(mTextBox, 0, 30, w, 175, 0)
- printer(mSetTextFont, gPropFont)
- printer(mSetTextStyle, "normal,bold")
- printer(mSetTextSize, 18)
- printer(mSetTextJust, "center")
- printer(mAppendText, "Express Service 1-800-443-3395" & RETURN & RETURN, 0)
- printer(mTextBox, 0, 70, w, 175, 0)
- printer(mSetTextFont, gPropFont)
- printer(mSetTextStyle, "normal")
- printer(mSetTextSize, 12)
- printer(mSetTextJust, "left")
- printer(mAppendText, the text of member "label" & RETURN, 0)
- set begBox to 180
- printer(mStrokedRect, 0, begBox, w, begBox + 300)
- set columnWidth to w / 8
- printer(mLine, columnWidth, begBox, columnWidth, begBox + 242)
- repeat with i = 5 to 6
- printer(mLine, i * columnWidth, begBox, i * columnWidth, begBox + 242)
- end repeat
- printer(mLine, 7 * columnWidth, begBox, 7 * columnWidth, begBox + 299)
- set eachBox to begBox + 20
- printer(mDrawText, "Cat #", 5, eachBox - 3)
- printer(mDrawText, "Description", columnWidth + 7, eachBox - 3)
- printer(mDrawText, "Price", (5 * columnWidth) + 7, eachBox - 3)
- printer(mDrawText, "Quantity", (6 * columnWidth) + 7, eachBox - 3)
- printer(mDrawText, "Amount", (7 * columnWidth) + 7, eachBox - 3)
- printer(mLine, 0, eachBox, w - 1, eachBox)
- repeat with i = 1 to 7
- set eachBox to eachBox + 37
- if (i = 4) or (i = 6) then
- printer(mTextBox, 5, eachBox - 30, (5 * columnWidth) - 2, eachBox, 0)
- else
- end if
- printer(mLine, 0, eachBox, w - 1, eachBox)
- end repeat
- printer(mSetTextJust, "right")
- printer(mTextBox, 0, eachBox - 32, (7 * columnWidth) - 5, h, 0)
- printer(mAppendText, "FAF Membership Discount", 0)
- printer(mLine, 0, eachBox - 18, w - 1, eachBox - 18)
- printer(mTextBox, 0, eachBox - 14, (7 * columnWidth) - 5, h, 0)
- printer(mSetTextJust, "right")
- printer(mAppendText, "Shipping", 0)
- printer(mTextBox, 0, eachBox + 8, (7 * columnWidth) - 5, h, 0)
- printer(mAppendText, "Total", 0)
- printer(mTextBox, 0, 490, w, h, 0)
- printer(mSetTextJust, "left")
- printer(mAppendText, the text of member "pay" & RETURN, 0)
- printer(mTextBox, 0, 623, w, h, 0)
- printer(mSetTextFont, gPropFont)
- printer(mSetTextStyle, "normal,bold")
- printer(mSetTextSize, 12)
- printer(mSetTextJust, "center")
- printer(mAppendText, the text of member "address" & RETURN, 0)
- printer(mNewPage)
- printOrderInfo()
- cursor(0)
- end
-
- on printOrderInfo
- global printer, gPropFont, w, h
- cursor(4)
- printer(mTextBox, 0, 25, w, h - 60, 0)
- printer(mSetTextJust, "center")
- AppendTitleText(the text of member "docTitle")
- printer(mSetTextJust, "left")
- set curCast to the number of member "docTitle" + 1
- repeat while the name of member curCast = "Product"
- AppendTitleText(the text of member curCast)
- set curCast to curCast + 1
- end repeat
- end
-
- on printMonthlyCalendar
- global printer, gPropFont, previewOnly, usrName, userNo, currentCycleNo, h, stamp, mucus, relations, endDate, beginDate
- cursor(4)
- set max to count(stamp)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- set pages to 1
- set min to 1
- if (max * 15) > w then
- set max to w / 25
- set pages to (count(stamp) / max) + 1
- end if
- set last to max
- repeat with Z = 1 to pages
- printer(mTextBox, 0, 40, w, 150, 0)
- printer(mSetTextSize, 12)
- printer(mSetTextStyle, "normal,bold")
- printer(mAppendText, getAt(usrName, userNo) & "'s Chart" & RETURN & RETURN)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal")
- printer(mAppendText, "Cycle #" & currentCycleNo & RETURN & RETURN & "First Entry: " && GetLongDate(beginDate) & RETURN & "Last Entry: " && GetLongDate(endDate))
- if (max * 25) < w then
- set eachWidth to 25
- else
- set eachWidth to w / max
- end if
- set eachHeight to 200
- printer(mStrokedRect, -2, eachHeight - 20, w, eachHeight + (4 * eachWidth) + 4)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal")
- set loc to 1
- repeat with i = min to last
- if i > 9 then
- set CorrectionNo to 6
- else
- set CorrectionNo to 2
- end if
- if the hilite of member "color" or (previewOnly = 1) then
- set stampName to "ministamp"
- set relationName to "miniRel"
- else
- set stampName to "graystamp"
- set relationName to "grayrel"
- end if
- printer(mDrawText, string(i), (eachWidth * (loc - 1)) + (eachWidth / 2) - CorrectionNo, 194)
- if getAt(stamp, i) <> 0 then
- printer(mPicture, the picture of member (stampName && string(getAt(stamp, i))), eachWidth * (loc - 1), eachHeight, (eachWidth * loc) - 1, eachHeight + eachWidth)
- end if
- if getAt(mucus, i) <> 0 then
- printer(mPicture, the picture of member ("miniMucus " & string(getAt(mucus, i))), eachWidth * (loc - 1), eachHeight + eachWidth + 1, (eachWidth * loc) - 1, eachHeight + 1 + (3 * eachWidth))
- end if
- if i < max then
- if (getAt(relations, i) <> 0) and (getAt(relations, i) <> 4) then
- printer(mPicture, the picture of member (relationName && string(getAt(relations, i))), eachWidth * (loc - 1), eachHeight + 2 + (3 * eachWidth), (eachWidth * loc) - 1, eachHeight + 2 + (4 * eachWidth))
- end if
- end if
- set loc to loc + 1
- end repeat
- if not (the hilite of member "color") and (previewOnly = 0) then
- printer(mSetTextFont, gPropFont)
- printer(mSetTextSize, 14)
- printer(mSetTextStyle, "normal,bold")
- set diffSpace to 30
- set heightSpace to h - 170
- printer(mDrawText, "Key:", (w / 6) - 20, heightSpace + 20)
- printer(mPicture, the picture of member "graystamp 1", w / 6, heightSpace + diffSpace)
- printer(mDrawText, "Red Stamp", (w / 6) + 30, heightSpace + diffSpace + 18)
- printer(mPicture, the picture of member "graystamp 2", w / 6, heightSpace + (2 * diffSpace))
- printer(mDrawText, "Brown Stamp", (w / 6) + 30, heightSpace + (2 * diffSpace) + 18)
- printer(mPicture, the picture of member "graystamp 3", w / 6, heightSpace + (3 * diffSpace))
- printer(mDrawText, "White Baby Stamp", (w / 6) + 30, heightSpace + (3 * diffSpace) + 18)
- printer(mPicture, the picture of member "graystamp 10", w / 6, heightSpace + (4 * diffSpace))
- printer(mDrawText, "Peak Baby Stamp", (w / 6) + 30, heightSpace + (4 * diffSpace) + 18)
- printer(mPicture, the picture of member "graystamp 4", w / 2, heightSpace + diffSpace)
- printer(mDrawText, "Yellow Baby Stamp", (w / 2) + 30, heightSpace + diffSpace + 18)
- printer(mPicture, the picture of member "graystamp 5", w / 2, heightSpace + (2 * diffSpace))
- printer(mDrawText, "Brown Baby Stamp", (w / 2) + 30, heightSpace + (2 * diffSpace) + 18)
- printer(mPicture, the picture of member "graystamp 6", w / 2, heightSpace + (3 * diffSpace))
- printer(mDrawText, "Yellow Stamp", (w / 2) + 30, heightSpace + (3 * diffSpace) + 18)
- end if
- cursor(0)
- if (pages > 1) and (Z < pages) then
- set min to min + max
- set last to last + max
- if last > count(stamp) then
- set last to count(stamp)
- end if
- printer(mNewPage)
- end if
- end repeat
- end
-
- on printBioData
- global printer, previewOnly, usrName, userNo, bioInfo, gPropFont, h
- if not objectp(printer) then
- cursor(0)
- alert("There is no currently selected printer. Printing features are disabled.")
- else
- cursor(4)
- printer(mReset)
- printer(mSetLandscapeMode, 0)
- setupprinting()
- printer(mSetDocumentName, "Nature's Method Biographical Data")
- printer(mSetProgressMsg, "Nature's Method Biographical Data")
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- printer(mTextBox, 0, 30, w, h - 24, 1)
- printer(mSetTextFont, gPropFont)
- printer(mSetTextSize, 12)
- printer(mSetTextStyle, "normal,bold")
- AppendTitleText("Biographical Data for" && getAt(usrName, userNo) & RETURN & RETURN)
- if max(bioInfo) = 15 then
- if min(bioInfo) <> 1 then
- AppendTitleText(the text of field "profile 15" & RETURN & RETURN)
- end if
- set x to count(bioInfo)
- repeat with i = 1 to x - 1
- if (getAt(bioInfo, i) = 13) or (getAt(bioInfo, i) = 8) or (getAt(bioInfo, i) = 2) or (getAt(bioInfo, i) = 12) then
- AppendTitleText(i & ") " & the text of field ("profile 15-" & getAt(bioInfo, i)))
- next repeat
- end if
- AppendTitleText(i & ") " & the text of field ("profile" && getAt(bioInfo, i)))
- end repeat
- else
- AppendTitleText(the text of field "profile 14" & RETURN & RETURN)
- set x to count(bioInfo)
- repeat with i = 1 to x - 1
- if (getAt(bioInfo, i) = 13) or (getAt(bioInfo, i) = 8) or (getAt(bioInfo, i) = 2) or (getAt(bioInfo, i) = 12) then
- AppendTitleText(i & ") " & the text of field ("profile 14-" & getAt(bioInfo, i)))
- next repeat
- end if
- AppendTitleText(i & ") " & the text of field ("profile" && getAt(bioInfo, i)))
- end repeat
- end if
- cursor(0)
- printItNow()
- end if
- end
-
- on setupprinting
- global printer, gPropFont, h, registered
- printer(mSetMargins, 72, 60, 72, 48)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- printer(mSetPageNumSymbol, "√û")
- printer(mSetTextFont, gPropFont)
- printer(mSetTextSize, 14)
- printer(mSetTextStyle, "normal,bold")
- printer(mSetTextJust, "left")
- printer(mDrawText, "Nature's Method", 0, 8)
- printer(mSetTextFont, gPropFont)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal,italic")
- printer(mSetTextJust, "right")
- printer(mDrawText, the date, w, 8)
- printer(mLine, 0, 18, w, 18)
- if registered <> "BVM" then
- printer(mDrawText, "Printed by an unregistered copy of Nature's Method. page √û", w, h - 2)
- else
- printer(mDrawText, "page √û", w, h - 2)
- end if
- printer(mSetTextJust, "left")
- printer(mNewPage)
- end
-
- on printItNow
- global printer, previewOnly, registered
- if previewOnly then
- printer(mPrintPreview)
- else
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mPrint)
- if registered <> "BVM" then
- cursor(0)
- alert("Your copy of Nature's Method is unregistered. An order form will be printed.")
- updateStage()
- mainPrintOrder()
- if printer(mDoJobSetup) = 1 then
- printer(mPrint)
- end if
- end if
- end if
- end if
- end
-
- on AppendTitleText txt
- global printer, gPropFont
- printer(mSetTextFont, gPropFont)
- printer(mSetTextStyle, "bold")
- printer(mSetTextSize, 14)
- printer(mAppendText, line 1 of txt & RETURN, 1)
- printer(mSetTextStyle, "normal")
- printer(mSetTextSize, 10)
- set countText to countText + printer(mAppendText, line 2 to the number of lines in txt of txt & RETURN & RETURN, 1)
- end
-
- on AppendSpacedText txt
- global printer, gPropFont
- printer(mSetTextFont, gPropFont)
- printer(mSetTextStyle, "normal")
- repeat with cnt = 1 to the number of lines in txt
- printer(mSetTextSize, 10)
- printer(mAppendText, line cnt of txt)
- printer(mSetTextSize, 14)
- printer(mAppendText, " " & RETURN)
- end repeat
- end
-
- on mainPrintMonthly
- global previewOnly, cycleNo, userNo, currentCycleNo
- printer(mReset)
- printer(mSetLandscapeMode, 1)
- setupprinting()
- printer(mSetDocumentName, "Nature's Method Monthly Calendar")
- printer(mSetProgressMsg, "Nature's Method Monthly Calendar")
- if the hilite of member "current monthly" then
- if count(stamp) > 0 then
- printMonthlyCalendar()
- printItNow()
- else
- cursor(0)
- alert("No days have been charted for this cycle.")
- exit
- end if
- else
- set A to integer(the text of field "begin number")
- set Z to integer(the text of field "end number")
- if integerp(Z) and integerp(A) then
- if Z > getAt(cycleNo, userNo) then
- set Z to getAt(cycleNo, userNo)
- end if
- if A < 1 then
- set A to 1
- end if
- repeat with i = A to Z
- set currentCycleNo to i
- readCycleInfo()
- if count(stamp) > 0 then
- printMonthlyCalendar()
- end if
- if i < Z then
- printer(mNewPage)
- end if
- end repeat
- printItNow()
- else
- cursor(0)
- alert("Please enter integer values for the Cycle #'s to be printed.")
- end if
- end if
- if currentCycleNo <> getAt(cycleNo, userNo) then
- set currentCycleNo to getAt(cycleNo, userNo)
- readCycleInfo()
- end if
- end
-
- on mainPrintDaily
- global previewOnly, cycleNo, userNo, currentCycleNo, endDate, beginDate, h
- printer(mReset)
- printer(mSetLandscapeMode, 0)
- setupprinting()
- printer(mSetDocumentName, "Nature's Method Daily Calendar")
- printer(mSetProgressMsg, "Nature's Method Daily Calendar")
- if the hilite of member "current daily" then
- if count(stamp) > 0 then
- set A to integer(the text of field "begin current daily")
- set Z to integer(the text of field "end current daily")
- if integerp(Z) and integerp(Z) then
- if Z > count(stamp) then
- set Z to count(stamp)
- end if
- if Z < 1 then
- set Z to 1
- end if
- if A < 1 then
- set A to 1
- end if
- repeat with i = A to Z
- printDailyCalendar(i)
- if i < Z then
- printer(mNewPage)
- end if
- end repeat
- printItNow()
- else
- cursor(0)
- alert("Please enter integer values for the Day #'s to be printed.")
- end if
- else
- cursor(0)
- alert("No pages found to print for the current cycle.")
- exit
- end if
- else
- set A to integer(the text of field "begin number")
- set Z to integer(the text of field "end number")
- if integerp(Z) and integerp(A) then
- set C to integer(the text of field "cycle number")
- if (C > getAt(cycleNo, userNo)) or (C < 0) then
- cursor(0)
- alert("Invalid Cycle Number")
- exit
- else
- set currentCycleNo to C
- readCycleInfo()
- end if
- if count(stamp) > 0 then
- if Z > count(stamp) then
- set Z to count(stamp)
- end if
- if A < 1 then
- set A to 1
- end if
- repeat with i = A to Z
- printDailyCalendar(i)
- if i < Z then
- printer(mNewPage)
- end if
- end repeat
- printItNow()
- end if
- else
- cursor(0)
- alert("Please enter integer values for the Day #'s to be printed.")
- end if
- end if
- if currentCycleNo <> getAt(cycleNo, userNo) then
- set currentCycleNo to getAt(cycleNo, userNo)
- readCycleInfo()
- end if
- end
-